package com.example.sysao.service.impl;

import com.example.sysao.mapper.UrgmentMapper;
import com.example.sysao.pejo.Urgent;
import com.example.sysao.service.UrgentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UrgentServiceImp implements UrgentService {

    @Resource
    private UrgmentMapper urgentmapper;

    @Override
    public boolean addUrgent(Urgent urgent) {
        return urgentmapper.insertUrgent(urgent) != 0;

    }

    @Override
    public List<Urgent> findAll() {
        return urgentmapper.selectAll();
    }

    @Override
    public boolean removeUrgent(int id) {
        return urgentmapper.deleteById(id) != 0;
    }

    @Override
    public boolean saveUrgent(Urgent urgent) {
        return urgentmapper.updateById(urgent) != 0;
    }

    @Override
    public boolean removeUrgentr(int repairId) {
        return urgentmapper.deliteByRid(repairId) != 0;
    }

    @Override
    public Urgent findById(int id) {
        return urgentmapper.selectById(id);
    }

    @Override
    public int findByRapirId(int id) {
        return urgentmapper.selectByRepairId(id);
    }

    @Override
    public Urgent findByRapirid(int id) {
        return urgentmapper.selectByRepairid(id);
    }
}
